<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html"/>

	<xsl:template match="/">
		<html>
			<head>
				<style>
	.n1,.n2,.n3,.n4,.n5,.n6,.n7,.n8,.n9,.n10{
    width:30px;
    text-align:center;
    }
	
	.n1,.n2,.n3{	color:red;	}
	.n4,.n5{	color:green;}
	.n6,.n7,.n8,.n9,.n10{	color:blue;	}

    table #notasTable{
    font-family:arial;
    font-size:10px;
	padding: 0px 0px;
	margin:0px 0px 0px 0px;
    }
    #notasTable thead{
    font-family:arial;
    font-size:10px;
    background: #FCD387;
    text-align:center;
	margin:0px 0px 0px 0px;
    }
	#notasTable tr, p{
	padding: 0px 0px ;
	margin:0px 0px 0px 0px;
	}

	#notasTable td{
    border:solid 1px gray;
	padding: 0px 0px ;
	margin:0px 0px 0px 0px;
    }
    .Alumno{
    font-size:12px;
	font-weight:bold;
    }
    
    .detallenotas{
    font-size:10px;
    width:100px;
		text-align:center;
    }
    .notaNombre{
    width:50px;
    height:20px;
    overflow:hidden;
    }
    .ItemNota{
    width:50px;
    height:20px;
    overflow:hidden;
    }
    .periodoactual{
    background: #FEF0D6;
    text-align:center;
    }
    .promedioGral{
    background: #FCD387;
    text-align:center;
    font-size:16px;
    }
    .notaselected{
    background: #FCD387;
    cursor:pointer;
    }
    .rowSelect{
    background: lightyellow;
	font-size:12px;
	font-weight:bold;
   height:none;
    }
	
	.cuatrimestral{
	width:200px;
	overflow:hidden;
	font-size:10px;
	font-weight:0;
	
	}
	.tableDetalleNotas{
		overflow:auto; 
			height:100px; 
			align:left;
			background:rgb(200,200,200);
	}
	</style>

	<style media="print">
	.tableDetalleNotas{
		overflow:auto; 
		align:left;
		

	}
	</style>
			</head>
			<body>
				<table id="notasTable">
					<thead>
						<td style="width:250px;">Alumno</td>
						<xsl:for-each select="alumnos/alumno[1]/periodos/periodo">
							<td>
								<xsl:value-of select="@name"/>
							</td>
						</xsl:for-each>
		<!--
						<xsl:for-each select="//alumno[1]/notas">
							<td>
								<xsl:value-of select="@Periodo"/>
								<br/>
								<xsl:value-of select="@Particion"/>
							</td>
						</xsl:for-each>
			-->	
			<td>
			
			Notas
			</td>
			
					</thead>
					<xsl:for-each select="alumnos/alumno">
						<tr class="Alumno" onmouseover="this.className='rowSelect';" onmouseout="this.className='Alumno';">
							<td>
								<xsl:value-of select="@nombre"/>
								<!--show data cuatrimestrales-->
								<xsl:apply-templates select="Cuatrimestrales/cuatrimetral"/>
							</td>
							<xsl:apply-templates select="periodos/periodo"></xsl:apply-templates>
							<td>
							
							<div class="tableDetalleNotas" >
							<table>
							<xsl:apply-templates select="notas"></xsl:apply-templates>
							</table>
							</div>
							
							</td>
						</tr>
					</xsl:for-each>
				</table>
			</body>
		</html>
	</xsl:template>

	<!--PERIODOS-->
	<xsl:template match="periodos/periodo">
		<td>
			<xsl:if test="@actual">
				<xsl:attribute name="class">periodoactual</xsl:attribute>
			</xsl:if>
			<xsl:if test="@resumen">
				<xsl:attribute name="class">promedioGral</xsl:attribute>
			</xsl:if>
			<span>
				<xsl:attribute name="class">n<xsl:value-of select="round(.)"/></xsl:attribute>
				<xsl:value-of select="."></xsl:value-of>
			</span>
		</td>
	</xsl:template>
	<!--PERIODOS-->



	<!-- detalle de notas -->
	<xsl:template match="notas">
		<tr>
			<xsl:if test="@actual">
				<xsl:attribute name="class">periodoactual</xsl:attribute>
			</xsl:if>
			<td class="detallenotas">
			<xsl:value-of select="@Particion"/>
			</td>
		<td>
			
			<table class="detallenotas">
						<xsl:for-each select="nota">
						<tr>
							<xsl:attribute name="title">
								<xsl:value-of select="@name"/>
							</xsl:attribute>
							<xsl:apply-templates select="item"/>
						</tr>
						</xsl:for-each>
			</table>
			</td>
		</tr>
		<!--
  <a href="#"><xsl:attribute name="onClick">
	modificarNotas(<xsl:value-of select="parent::node()/@idAlumnoCurso"/>,'<xsl:value-of select="parent::node()/@nombre"/>');	
</xsl:attribute>Editar</a>
-->
	</xsl:template>
	<!-- Fin detalle de notas -->


	<!-- nota item -->
	<xsl:template match="item">
		<td>
			<div style="text-align:center;width:35px;" onmouseover="this.className='notaselected';">
				<xsl:attribute name="onmouseout">this.className='n<xsl:value-of select="round(.)"/>';</xsl:attribute>
				<xsl:attribute name="title">
					<xsl:value-of select="parent::node()/@name"/>/<xsl:value-of select="@detalle"/></xsl:attribute>
				<xsl:attribute name="class">n<xsl:value-of select="round(.)"/></xsl:attribute>
				<xsl:attribute name="value">
					<xsl:value-of select="."/>
				</xsl:attribute>
				<xsl:if test="round(.)=0">A</xsl:if>
				<xsl:if test="round(.)!=0">
					<xsl:value-of select="."/>
				</xsl:if>
			</div>
		</td>
	</xsl:template>
	<!-- nota item -->


	<!--Cuatrimestrales-->
	<xsl:template match="cuatrimetral">
		<div class="cuatrimestral">
			
			<div style="float:left;">
			
			<xsl:value-of select="@name"/>:</div>
			<div style="float:left;">
			<xsl:attribute name="class">n<xsl:value-of select="round(.)"/></xsl:attribute>
			<xsl:value-of select="."></xsl:value-of></div>
		</div>
	</xsl:template>
	<!--Cuatrimestrales-->
</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2004. Sonic Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\..\Temp\miData.xml" htmlbaseurl="" outputurl="" processortype="internal" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition></MapperMetaTag>
</metaInformation>
-->